package com.pine.dcts.handler;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pine.dcts.common.CURDHandler;
import com.pine.dcts.common.Result;
import com.pine.dcts.entity.User;
import com.pine.dcts.query.UserQuery;
import com.pine.dcts.service.UserService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/user")
@RestController
public class UserHandler extends CURDHandler<UserService, User> {


    @GetMapping("/page")
    public Result<Page<User>> page(@Validated UserQuery query){
        return  Result.success(this.service.selectPage(query));
    }
}
